package com.kyivmohyla.kma2.client.view.header;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.*;
import com.kyivmohyla.kma2.client.presenter.header.HeaderPresenter;

public class Header extends Composite implements HeaderPresenter.Display {
    private static HeaderUiBinder ourUiBinder = GWT.create(HeaderUiBinder.class);
    @UiField
    protected Button logout;
    @UiField
    protected Label firstName;
    @UiField
    protected Label lastName;
    @UiField
    protected Label position;

    public Header() {
        initWidget(ourUiBinder.createAndBindUi(this));
    }

    @Override
    public HasClickHandlers getLogoutButton() {
        return logout;
    }

    @Override
    public HasText getFirstName() {
        return firstName;
    }

    @Override
    public HasText getLastName() {
        return lastName;
    }

    @Override
    public HasText getPosition() {
        return position;
    }

    @Override
    public Widget asWidget() {
        return this;
    }

    interface HeaderUiBinder extends UiBinder<Widget, Header> {
    }
}